package com.example.vue_shop.components.rights.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vue_shop.components.rights.entity.Rights;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author lipengwei
 */
@Mapper
public interface RightsMapper extends BaseMapper<Rights> {

    /**
     * 获取父级权限名称
     * @param parentId 父级权限停车
     * @return String
     */
    String getRightsParentNameByParentId(int parentId);

    /**
     * 获取当前角色的权限.
     * @param roleId 角色Id
     * @return List<Rights>
     */
    List<Rights> getRightsListByRoleId(@Param("roleId") int roleId);

    /**
     * 获取所有权限,含有父级权限名称.
     * @return List<Rights>
     */
    List<Map<String, Object>> getRightsAll();
}
